package demo02;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-25
 * Time: 21:28
 */
public class Test02 {
    public static  ArrayList<Character> func(String s1,String s2) {
        ArrayList<Character> arr = new ArrayList<>();
        int i,j;
        for ( i = 0; i < s1.length(); i++) {
            for( j=0 ;j<s2.length() ;j++) {
                if( s1.charAt(i) == s2.charAt(j)) {
                    break;
                }
            }
            if( j == s2.length()) {
                arr.add( s1.charAt(i));
            }
        }
        return arr;
    }
    public static void main(String[] args) {
        String s1 = "welcome to bit";
        String s2 = "come";
        //遍历s1 ,不在S2中放到list中
        ArrayList<Character> arr = func(s1, s2) ;
        System.out.println(arr);
    }
}
